﻿using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;
using Castle.Components.Validator;
using MiragePWF.NH.Validation;
using Wolfut.MirageEE.Kernal.Common;
using Wolfut.MirageEE.Domain.CommonUtilities;

namespace Wolfut.MirageEE.Domain.Products
{
    /// <summary>
    /// 产品转换单信息
    /// </summary>
    [ActiveRecord("PRODUCT_TRANSFORM_BILLS")]
    public class ProductAssemblyOrder : PersistentObjectWithGuid
    {
        #region 产品转换单编号
        private string productTransferCode = string.Empty;
        /// <summary>
        /// 产品转换单编号
        /// </summary>
        [Property("PRODUCT_TRANSFER_CODE")]
        [ValidateIsUniqueInSameTransactionWithString(true, "数据库已经存在相同的产品转换单编号！")]
        [ValidateNonEmpty, ValidateLength(0, 100, "产品转换单编号超长！")]
        public virtual string ProductTransferCode
        {
            get
            {
                return productTransferCode;
            }
            set
            {
                productTransferCode = value;
            }
        }
        #endregion

        #region 组合后商品编号
        private string compagesWareCode = string.Empty;
        /// <summary>
        /// 组合后商品编号
        /// </summary>
        [Property("COMPAGES_WARE_CODE")]
        [ValidateNonEmpty, ValidateLength(0, 100, "组合后商品编号超长！")]
        public virtual string CompagesWareCode
        {
            get
            {
                return compagesWareCode;
            }
            set
            {
                compagesWareCode = value;
            }
        }
        #endregion

        #region 子件数量合计
        private Decimal subProductSum;
        /// <summary>
        /// 子件数量合计
        /// </summary>
        [Property("SUB_PRODUCTS_SUM")]
        public virtual Decimal SubProductSum
        {
            get
            {
                return subProductSum;
            }
            set
            {
                subProductSum = value;
            }
        }
        #endregion

        #region 组合后商品的数量
        private Decimal compageWareSum;
        /// <summary>
        /// 组合后商品的数量
        /// </summary>
        [Property("COMPAGES_WARE_SUM")]
        public virtual Decimal CompageWareSum
        {
            get
            {
                return compageWareSum;
            }
            set
            {
                compageWareSum = value;
            }
        }
        #endregion

        #region 转换时间
        private DateTime transferDate;
        [Property("TRANSFER_DATE")]
        public virtual DateTime TransferDate
        {
            get
            {
                return transferDate;
            }
            set
            {
                transferDate = value;
            }
        }
        #endregion

        #region 仓库
        private string warehouseCode = string.Empty;
        /// <summary>
        /// 仓库
        /// </summary>
        [Property("WAREHOUSE_CODE")]
        [ValidateLength(0, 100, "仓库超长！")]
        public virtual string WarehouseCode
        {
            get
            {
                return warehouseCode;
            }
            set
            {
                warehouseCode = value;
            }
        }
        #endregion

        #region 是否是存货模板
        private Int16 isTemplate;
        /// <summary>
        /// 是否是存货模板
        /// </summary>
        [Property("IS_TEMPLATE")]
        public virtual Int16 IsTemplate
        {
            get
            {
                return isTemplate;
            }
            set
            {
                isTemplate = value;
            }
        }
        #endregion

        #region 逻辑删除
        private Int16 isDeleted;
        /// <summary>
        /// 是否删除
        /// </summary>
        [Property("IS_DELETED")]
        public virtual Int16 IsDeleted
        {
            get
            {
                return isDeleted;
            }
            set
            {
                isDeleted = value;
            }
        }
        #endregion

        #region 存货地点（仓库ID）
        //[Property]
        //[ValidateLength(0, 40, "默认存货地点超长！")]
        //public virtual string ProductWarebasesID
        //{
        //    get
        //    {
        //        return productNo;
        //    }
        //    set
        //    {
        //        productNo = value;
        //    }
        //}
        #endregion
    }
}
